import request from '@/utils/request'

/**
 * 获取月卡列表
 * @param { page, pageSize} params
 * @returns
 */
export function getCardListAPI(params) {
  return request({
    url: '/parking/card/list',
    params
  })
}
// 添加月卡
export function createCardAPI(data) {
  return request({
    url: '/parking/card',
    method: 'POST',
    data
  })
}
// 先获取后更新
// 获取月卡/parking/card/detail/{id}
export function getCardDetailAPI(id) {
  return request({
    url: `/parking/card/detail/${id}`
  })
}
// 更新月卡/parking/card/edit
export function updateCardAPI(data) {
  return request({
    url: '/parking/card/edit',
    method: 'PUT',
    data
  })
}

// delCardAPI
// /parking/card/{ids}
// 删除月卡
export function delCardAPI(ids) {
  return request({
    url: `/parking/card/${ids}`,
    method: 'DELETE'
  })
}
/**
 * 批量删除月卡
 * @param {*} ids [1,2,3]
 * @returns
 */
export function delAllCardAPI(ids) {
  return request({
    url: `/parking/card/${ids.join(',')}`,
    method: 'DELETE'
  })
}
